home *** CD-ROM | disk | FTP | other *** search
- ELF_RAND(3E) Last changed: 10-13-98
-
-
- NNAAMMEE
- eellff__rraanndd - Provides random archive member access
-
- SSYYNNOOPPSSIISS
- cccc [_f_l_a_g ...] _f_i_l_e ... --lleellff [_l_i_b_r_a_r_y ...]
-
- ##iinncclluuddee <<lliibbeellff..hh>>
-
- ssiizzee__tt eellff__rraanndd((EEllff **eellff,, ssiizzee__tt ooffffsseett));;
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- IRIX systems
-
- DDEESSCCRRIIPPTTIIOONN
- eellff__rraanndd, eellff__nneexxtt, and eellff__bbeeggiinn manipulate simple object files and
- archives. eellff is an ELF descriptor previously returned from
- eellff__bbeeggiinn.
-
- eellff__rraanndd provides random archive processing, preparing eellff to access
- an arbitrary archive member. eellff must be a descriptor for the archive
- itself, not a member within the archive. ooffffsseett gives the byte offset
- from the beginning of the archive to the archive header of the desired
- member. See eellff__ggeettaarrssyymm(3E) for more information about archive
- member offsets. When eellff__rraanndd works, it returns ooffffsseett. If an error
- occurred, eellff was null, or the file was not an archive (no archive
- member can have a zero offset), it returns 0. A program may mix
- random and sequential archive processing.
-
- EEXXAAMMPPLLEESS
- An archive starts with a ``magic string'' that has SSAARRMMAAGG bytes; the
- initial archive member follows immediately. An application could
- provide the following function to rewind an archive (the function
- returns -1 for errors and 0, otherwise):
-
- #include <ar.h>
- #include <libelf.h>
-
- int
- rewindelf(Elf *elf)
- {
- if (elf_rand(elf, (size_t)SARMAG) == SARMAG)
- return 0;
- return -1;
- }
-
- SSEEEE AALLSSOO
- eellff(3E), eellff__bbeeggiinn(3E), eellff__ggeettaarrssyymm(3E), eellff__nneexxtt(3E), aarr(4)
-
- This man page is available only online.
-
-